#include <list>
#include <vector>
#include <iostream>
#include "mtm.h"
#include <exception>
using std::cerr;
using std::cout;
using std::endl;
template <class T, class Type>
class Stack{
	 Type data;
public:
	class Empty : public std::exception {};
	void push(const T& element){
		data.push_back(element);
	}
	void pop(){
		if(data.empty()){
			throw Empty();
		}
		data.pop_back();
	}
	T& top(){
		if(data.empty()){
			throw Empty();
		}
		return data.back();
	}

	Stack<T, Type>& operator=(Stack<T, Type>& s){
		if(s.data==data){
			return *this;
		}
		data.~Type();
		data = s.data;
		return *this;
	}
};


#include <iostream>
using std::cerr;
using std::cout;
using std::endl;
class A{
public:
	virtual void printError(){
		cout<<"1"<<endl;
	}
}
class B: public A{
	void printError(){
		cout<<"2"<<endl;
	}
};
void f(){
	throw B();
}
